class TicketsController < ApplicationController
  skip_before_filter :confirm_is_admin ,:only =>[:index,:create,:new, :show,:edit,:update,:destroy]
def index
  @tickets = Ticket.all
end
def new
    @Newtic = Ticket.new
end
def create
  @Newtic = Ticket.new(params[:ticket])
  
    if @Newtic.save
      redirect_to dev_project_path(@Newtic.dev_project)   
    else
      render :action => "new"
    end
  end
def edit
  @Newtic = Ticket.find(params[:id])
end
def update
  @Newtic = Ticket.find(params[:id])
   if @Newtic.update_attributes(params[:ticket])
    redirect_to dev_projects_path(params[:id])
   else
     render :action => "edit"
  end
end
def destroy
  @Newtic = Ticket.find(params[:id])
  @Newtic.destroy
  redirect_to dev_projects_path
  end
end

